<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>Travel Dream - Home</title>
	<link href="style.css" rel="stylesheet" type="text/css" />
</h:head>
<h:body>
<div id="maincontainer">
  <div id="menu">
    <div>
    	<ul style="display:block;list-style-type:none;">
    		<li><a href="home.xhtml">HOME</a></li>
    		<li><a href="search package.xhtml">RICERCA PACCHETTO</a></li>
    		<li><a href="search component.xhtml">RICERCA COMPONENTE</a></li>
    	</ul>
    </div>
  </div>
  <div id="right_column">
		<h:form>
			<p:panelGrid>
				<f:facet name="header">
					Inserisci Camera
				</f:facet>
				<p:row>
						<p:column>
							<h:outputLabel for="roomNumber" value="Numero camera: *" />
						</p:column>
						<p:column>
							<p:inputText id="roomNumber" value="#{room.currentRoom.roomNumber}" label="roomNumber" />
						</p:column>
				</p:row>
				<p:row>
						<p:column>
							<h:outputLabel for="beds" value="Numero di letti: *" />
						</p:column>
						<p:column>
        					<p:selectOneMenu value="#{room.currentRoom.beds}">  
            					<f:selectItem itemLabel="Select One" itemValue="" />  
					            <f:selectItem itemLabel="Singola" itemValue="1" />  
					            <f:selectItem itemLabel="Doppia" itemValue="2" />  
					            <f:selectItem itemLabel="Matrimoniale" itemValue="2" />
					            <f:selectItem itemLabel="Tripla" itemValue="3" /> 
					            <f:selectItem itemLabel="Quadrupla" itemValue="4" /> 
        					</p:selectOneMenu>
						</p:column>
				</p:row>
				<p:row>
						<p:column>
							<h:outputLabel for="price" value="Prezzo: *" />
						</p:column>
						<p:column>
							<p:inputText id="price" value="#{room.currentRoom.price}" label="price" />
						</p:column>
				</p:row>
				<p:row>
						<p:column colspan="2">
							<p:commandButton value="Crea nuovo hotel" action="#{hotel.goToCreateHotel()}" />
						</p:column>
				</p:row>
				<p:row>
						<p:column colspan="2">
							<p:dataGrid var="h" value="#{room.hotelsDTO}" columns="1" rows="7" paginator="true" colspan="2">
						           <p:panel>
						              <h:panelGrid>
						              	<p:row>
							              	<p:column>Nome:  </p:column>
							              	<p:column>#{h.name}</p:column>
							            </p:row>  
							            <p:row>
							            	<p:column>Città:   </p:column>
							              	<p:column>#{h.addressDTO.city}</p:column>
						               	</p:row>
						               	<p:row>
						               		<p:column colspan="2">
						               			<h:commandButton action="#{room.create(h)}" value="Seleziona hotel e crea la camera!" />
						               		</p:column>
						               	</p:row>
						                  
						               </h:panelGrid>
						           </p:panel>
						  </p:dataGrid>
				 		</p:column>
				 </p:row>
			</p:panelGrid>
		</h:form>
		</div>
		</div>
	</h:body>
</html>